Skip to content

add ContentFilteredTopic example.#341

Merged
wjwwood merged 4 commits intoros2:masterfrom
fujitatomoya:feature-20220419-content-filtering
Apr 27, 2022
Merged

add ContentFilteredTopic example.#341
wjwwood merged 4 commits intoros2:masterfrom
fujitatomoya:feature-20220419-content-filtering

Conversation

@fujitatomoya
Copy link
Collaborator

should be linked to ROS 2 ContentFitleredTopic tutorial. (ros2/design#282)

related to ros2/demos#557

Signed-off-by: Tomoya Fujita Tomoya.Fujita@sony.com

Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com>
Copy link
Collaborator Author

@fujitatomoya fujitatomoya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just trying to use all interfaces provided by subscription content filtering here. and dealing with exceptions that might be generated via methods since users are likely to copy&paste the code from here to somewhere else.

@fujitatomoya
Copy link
Collaborator Author

CC: @wjwwood @ivanpauno @iuhilnehc-ynos

Copy link
Member

@wjwwood wjwwood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The example could be more "minimal" for copy-paste, but I think it's fine as-is to show more of how it could be used.

lgtm, with some suggestions addressed.

@fujitatomoya
Copy link
Collaborator Author

@wjwwood thanks for the comment, i borrowed your suggestions.

Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com>
Co-authored-by: William Woodall <william@osrfoundation.org>
@fujitatomoya
Copy link
Collaborator Author

CI:

  • Linux Build Status
  • Linux-aarch64 Build Status
  • Windows Build Status

Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com>
@fujitatomoya
Copy link
Collaborator Author

CI (address uncrustify errors):

  • Linux Build Status
  • Linux-aarch64 Build Status
  • Windows Build Status

@fujitatomoya
Copy link
Collaborator Author

example output for each rmw implementation.

  • publisher (same binary with RMW_IMPLEMENTATION setting)
ros2 run examples_rclcpp_minimal_publisher publisher_member_function
  • rmw_fastrtps (default)
# ros2 run examples_rclcpp_minimal_subscriber subscriber_content_filtering
[INFO] [1650647654.909896684] [minimal_contentfiltering_subscriber]: Subscribed to topic "/topic" with content filtering
[INFO] [1650647654.909990922] [minimal_contentfiltering_subscriber]: Content filtering expression and parameter are "data = %0" and "'Hello, world! 10'"
[INFO] [1650647663.337609015] [minimal_contentfiltering_subscriber]: I heard: 'Hello, world! 10'
[INFO] [1650647663.338324998] [minimal_contentfiltering_subscriber]: Content filtering expression and parameter are "data = %0" and "'Hello, world! 20'"
[INFO] [1650647668.337454893] [minimal_contentfiltering_subscriber]: I heard: 'Hello, world! 20'
[INFO] [1650647668.338167047] [minimal_contentfiltering_subscriber]: Content filtering expression and parameter are "data = %0" and "'Hello, world! 30'"
...<snip>
  • rmw_connextdds
# RMW_IMPLEMENTATION=rmw_connextdds ros2 run examples_rclcpp_minimal_subscriber subscriber_content_filtering
RTI Connext DDS Non-commercial license is for academic, research, evaluation and personal use only. USE FOR COMMERCIAL PURPOSES IS PROHIBITED. See RTI_LICENSE.TXT for terms. Download free tools at rti.com/ncl. License issued to Non-Commercial User license@rti.com For non-production use only.
Expires on 00-jan-00 See www.rti.com for more information.
[INFO] [1650647909.339308552] [minimal_contentfiltering_subscriber]: Subscribed to topic "/topic" with content filtering
[INFO] [1650647909.339387411] [minimal_contentfiltering_subscriber]: Content filtering expression and parameter are "data = %0" and "'Hello, world! 10'"
[INFO] [1650647926.630042121] [minimal_contentfiltering_subscriber]: I heard: 'Hello, world! 10'
[INFO] [1650647926.631364854] [minimal_contentfiltering_subscriber]: Content filtering expression and parameter are "data = %0" and "'Hello, world! 20'"
...<snip>
  • rmw_cyclonedds
# RMW_IMPLEMENTATION=rmw_cyclonedds_cpp ros2 run examples_rclcpp_minimal_subscriber subscriber_content_filtering
[WARN] [1650647987.733083073] [minimal_contentfiltering_subscriber]: Content filter is not enabled since it's not supported
[INFO] [1650647990.514812843] [minimal_contentfiltering_subscriber]: I heard: 'Hello, world! 0'
[INFO] [1650647991.014601673] [minimal_contentfiltering_subscriber]: I heard: 'Hello, world! 1'
[INFO] [1650647991.514611925] [minimal_contentfiltering_subscriber]: I heard: 'Hello, world! 2'
[INFO] [1650647992.014454205] [minimal_contentfiltering_subscriber]: I heard: 'Hello, world! 3'
[INFO] [1650647992.514540176] [minimal_contentfiltering_subscriber]: I heard: 'Hello, world! 4'
[INFO] [1650647993.014640461] [minimal_contentfiltering_subscriber]: I heard: 'Hello, world! 5'
...<snip>

@fujitatomoya
Copy link
Collaborator Author

Note: cross-vendor content filtering works between rmw_fastrtps and rmw_connextdds using this example.

Copy link
Member

@ivanpauno ivanpauno left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com>
@fujitatomoya fujitatomoya force-pushed the feature-20220419-content-filtering branch from 0ab473e to 6bc314e Compare April 22, 2022 20:10
@fujitatomoya
Copy link
Collaborator Author

either @ivanpauno or @wjwwood , could you help to merge this? i do not have access permission for this repo.

@clalancette
Copy link
Contributor

either @ivanpauno or @wjwwood , could you help to merge this? i do not have access permission for this repo.

Let's hold off until next week; we are trying to branch for Humble right now.

@fujitatomoya
Copy link
Collaborator Author

sorry, forgot that. thanks!

@wjwwood
Copy link
Member

wjwwood commented Apr 25, 2022

Yeah, this is ready, just waiting on Humble to unblock.

@fujitatomoya
Copy link
Collaborator Author

@clalancette could you merge this into master? so that i can link this example from ros2/ros2_documentation#2396 (release note).

@wjwwood wjwwood merged commit 9ff80f5 into ros2:master Apr 27, 2022
@fujitatomoya
Copy link
Collaborator Author

@Mergifyio backport rolling humble

mergify bot pushed a commit that referenced this pull request Apr 27, 2022
@mergify
Copy link
Contributor

mergify bot commented Apr 27, 2022

backport rolling humble

✅ Backports have been created

Details

clalancette pushed a commit that referenced this pull request May 9, 2022
Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com>

(cherry picked from commit 9ff80f5)
clalancette pushed a commit that referenced this pull request May 26, 2022
Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com>

(cherry picked from commit 9ff80f5)

Co-authored-by: Tomoya Fujita <Tomoya.Fujita@sony.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants